#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
int g1;
int backLight = 13; 

void setup()
{
  Serial.begin(9600);
  
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); 
  lcd.begin(16,2);             
  lcd.clear();                  
  lcd.setCursor(0,0);  
 
  lcd.print("Cafe com java");  
  lcd.setCursor(0,1);          
  lcd.print("Arduino e Java");
}

void loop()
{
    delay(1000);
     if (Serial.available() >= 1) {
       lcd.clear(); 
       lcd.setCursor(0,0);
      g1 = Serial.read();
      if(g1 == 1){
        lcd.print("Ola java");  
      }else{
        lcd.print("cafe com java");  
      }
           
     }else{
       lcd.clear(); 
       lcd.setCursor(0,0); 
       lcd.print("Sem comunicacao");     
     }


 
}

